using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Network;
using MicroMsg.Protocol;
using MicroMsg.Scene;
using System;
namespace MicroMsg.Plugin.Shake.Scene
{
	public class NetSceneShakeTranImgUnBind : NetSceneBaseEx<ShakeTranImgUnBindRequest, ShakeTranImgUnBindResponse, ShakeTranImgUnBindRequest.Builder>
	{
		private const string TAG = "NetSceneShakeTranImgUnBind";
		public bool doScene(ShakeTranImgOpType optype, ShakeTranImgScene scene)
		{
			Log.smethod_4("NetSceneShakeTranImgUnBind", "doscene in");
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mBuilder.Scene = (uint)optype;
			this.mBuilder.OpType = (uint)scene;
			this.mSessionPack.mCmdID = 130;
			base.endBuilder();
			return true;
		}
		protected override void onFailed(ShakeTranImgUnBindRequest request, ShakeTranImgUnBindResponse response)
		{
			PackResult lastError = base.getLastError();
			Log.smethod_4("NetSceneShakeTranImgUnBind", "onFailed in PackResult =" + lastError);
			if (lastError == PackResult.BEEN_CANCELLED)
			{
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_SHAKE_ERR, request.OpType, null);
		}
		protected override void onSuccess(ShakeTranImgUnBindRequest request, ShakeTranImgUnBindResponse response)
		{
			Log.smethod_4("NetSceneShakeTranImgUnBind", "onSuccess in");
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				EventCenter.postEvent(EventConst.ON_NETSCENE_SHAKE_TRAN_IMG_UNBIND_ERR, request.OpType, null);
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_SHAKE_TRAN_IMG_UNBIND_SUCCESS, request.OpType, null);
		}
	}
}
